using System;
using System.Data;
using System.Linq;
using System.ComponentModel;
using System.Reflection;
using System.Collections.Generic;
using DataObject.Model;
using DataObject.Database;

public partial class ReservationPaymentMapper
{
    #region ToEntity

    public static ReservationPayment ToEntity(ReservationPayment entity, ReservationPaymentDTO businessobject)
    {
        if (businessobject == null)
        {
            return null;
        }
        entity.IsDeposit = businessobject.IsDeposit;
        entity.PaymentBatchID = businessobject.PaymentBatchID;
        entity.ReservationID = businessobject.ReservationID;
        entity.ReservationPaymentID = businessobject.ReservationPaymentID;
        return entity;
    }

    #endregion

    #region ToBusinessObject

    public static ReservationPaymentDTO ToBusinessObject(ReservationPayment entity)
    {
        if (entity == null)
        {
            return null;
        }
        return new ReservationPaymentDTO
        {
            IsDeposit = entity.IsDeposit,
            PaymentBatchID = entity.PaymentBatchID,
            ReservationID = entity.ReservationID,
            ReservationPaymentID = entity.ReservationPaymentID,
            PaymentBatch = PaymentBatchMapper.ToBusinessObject(entity.PaymentBatch),
            Reservation = ReservationMapper.ToBusinessObject(entity.Reservation),
        };
    }

    #endregion

    #region ToBusinessObjectHasChildren

    public static ReservationPaymentDTO ToBusinessObjectHasChildren(ReservationPayment entity, params Type[] types)
    {
        if (entity == null)
        {
            return null;
        }
        ReservationPaymentDTO businessobject = new ReservationPaymentDTO
        {
            IsDeposit = entity.IsDeposit,
            PaymentBatchID = entity.PaymentBatchID,
            ReservationID = entity.ReservationID,
            ReservationPaymentID = entity.ReservationPaymentID,
            PaymentBatch = PaymentBatchMapper.ToBusinessObject(entity.PaymentBatch),
            Reservation = ReservationMapper.ToBusinessObject(entity.Reservation),
        };
        return businessobject;
    }

    #endregion

}
